package com.example.day01;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.day01.InfoList.InfoListActivity;
import com.example.day01.bim.BimHealthActivity;
import com.example.day01.book.BookSpActivity;
import com.example.day01.cacluatue.CalculatorActivity;
import com.example.day01.finger_guess.GuestActivity01;
import com.example.day01.lunbo.BannerActivity;
import com.example.day01.lunbo.BannerAdapter;
import com.example.day01.ptoto_wall.PhotoWallActivity;
import com.example.day01.register.Register;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    Button btn1,btn2,btn3,btn4,btn5,btn6,btn7,btn8;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        btn1=findViewById(R.id.main_btn1);
        btn2=findViewById(R.id.main_btn2);
        btn3=findViewById(R.id.main_btn3);
        btn4=findViewById(R.id.main_btn4);
        btn5=findViewById(R.id.main_btn5);
        btn6=findViewById(R.id.main_btn6);
        btn7=findViewById(R.id.main_btn7);
        btn8=findViewById(R.id.main_btn8);
        btn1.setOnClickListener(this);
        btn2.setOnClickListener(this);
        btn3.setOnClickListener(this);
        btn4.setOnClickListener(this);
        btn5.setOnClickListener(this);
        btn6.setOnClickListener(this);
        btn7.setOnClickListener(this);
        btn8.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        int id=v.getId();
        Intent intent = new Intent();
        switch (id){
            case R.id.main_btn1:
            intent.setClass(MainActivity.this, Register.class);
            break;
            case R.id.main_btn2:
                intent.setClass(MainActivity.this, CalculatorActivity.class);

                break;
            case R.id.main_btn3:
                intent.setClass(MainActivity.this, GuestActivity01.class);
                break;
            case R.id.main_btn4:
                intent.setClass(MainActivity.this, BimHealthActivity.class);
                break;
            case R.id.main_btn5:
                intent.setClass(MainActivity.this, BookSpActivity.class);
                break;
            case R.id.main_btn6:
                intent.setClass(MainActivity.this, InfoListActivity.class);

                break;
            case R.id.main_btn7:
                intent.setClass(MainActivity.this, PhotoWallActivity.class);
                break;
            case R.id.main_btn8:
                intent.setClass(MainActivity.this, BannerActivity.class);
                break;
        }
        startActivity(intent);
    }
}
